# Contributor: Hugo Rodrigues <hugo.rodrigues@openbit.tech>
# Maintainer: Hugo Rodrigues <hugo.rodrigues@openbit.tech>
pkgname=py3-uacme-desec
_pkgname=uacme-desec
pkgver=1.2.1
pkgrel=0
pkgdesc="An UACME hook for deSEC"
options="!check"
url="https://codeberg.org/openbit/uacme-desec"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-setuptools"
subpackages="$pkgname-pyc $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/openbit/uacme-desec/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname"

build() {
	# setuptools_scm will not work so we patch in the version into pyproject.toml
	sed -i -E "s/^dynamic.*version.*/version = \"$pkgver\"/g" pyproject.toml
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl

	install -Dm644 LICENSES/MIT.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
0848bea967dcefa847a74eaecb6efdcb46b360c462b2df865929dc8227d3bc7f405270b4dd09a9e935d38a780e03e719388c57f6f2450d673ab3cfadd8816f62  py3-uacme-desec-1.2.1.tar.gz
"
